<?php

/*
 +-----------------------------------------------
 |输出控制器--OutputController.php
 +-----------------------------------------------
 | Auth: dark2light@qq.com
 | Date: 2016.11.18
 +-----------------------------------------------
 |Main: 返回兵器相关信息【主要是游戏人数】
 +-----------------------------------------------
*/

namespace Tug\Controller;

use Tug\Utils\InputUtils;
use Plume\Core\Controller;
use Plume\Core\Service;
use Plume\Core\Dao;

class OutputController extends Controller
{
    private $gameSetService;
    public function __construct($app) {
        parent::__construct($app);
        //使用默认Service和默认DAO
        $this->gameSetService = new Service($app, new Dao($app, 'game_set'));
    }
	public function getPrizeUserInfoAction()
	{
		if(isset($_GET['sequence'])) {
			$sequence = $_GET['sequence'];
			if(!empty($sequence)) {
				$tugInfo = $this->gameSetService->fetch(['sequence' => $sequence]);
				if (!empty($tugInfo)) {
					exit(json_encode($tugInfo[0]));
				} else {
					exit(json_encode(['code' => -1 ,'msg' => "result is empty!!!", 'limit'=>'0']));
				}
			} else {
				exit(json_encode(['code' => -1 ,'msg' => "param sequence is missing!!!", 'limit'=>'0']));
			}
		} else {
			echo json_encode(array('code' => -1 ,'msg' => "param sequence is missing!!!", 'limit'=>'0'));
			exit;
		}
	}
}